# -b   common build
# -d   debug build
# -u   unit test build

function ReleaseBuild() {
    cmake -B build -G"$CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=Release
    cmake --build build -j8
}

function DebugBuild() {
    cmake -B build -G"$CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=Debug
    cmake --build build -j8
}

function UnitTestBuild() {
    cmake -B build -G"$CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=Debug -DUNIT_TEST=True
    cmake --build build -j8
}

while getopts "bdu" arg
do
  case $arg in
    b)
      ReleaseBuild
      ;;
    d)
      DebugBuild
      ;;
    u)
      UnitTestBuild
      ;;
    *)
      echo read scripts
      ;;
  esac
done